app = @bhv
app.directive('dotaTrend', ->
  restrict: 'E'
  replace: true
  scope: {}
  controller: ($scope)->
    #折线区块示意图
    lineAreaChartOption =
      series:[{
        name:'default',
        type:'line',
        symbol: 'none',
        itemStyle:
          normal:
            lineStyle: color: '#FFF', width: 4
            areaStyle: color: 'rgba(135, 113, 33, 0.6)'
        data: [10, 20, 30, 25, 36, 40, 48, 39, 46, 50]
        smooth: true
      }]
    #折线
    @getLineAreaChartOption = -> lineAreaChartOption

  templateUrl: 'views/data/data-trend.html'
  link: ($scope,  element, attrs, ctrl)->
    lineAreaChartElemnt = $(element).find('#lineAreaChart')
    new LineAreaChart(lineAreaChartElemnt[0], ctrl.getLineAreaChartOption())

    $scope.leftList = [
      {precent: 10, value: 1000, increase: 1}
      {precent: 25, value: 2500, increase: 1}
      {precent: 40, value: 4500, increase: 1}
      {precent: 35, value: 3500, increase: 0}
    ]
    $scope.centerHeight = 60
    $scope.centerText = 5500
)

app.directive('dotaSummary', ->
  restrict: 'E'
  replace: true
  scope: {}
  templateUrl: 'views/data/data-summary.html'
  link: ($scope,  element, attrs)->
)

app.directive('dotaAnalysis', ->
  restrict: 'E'
  replace: true
  scope: {}
  templateUrl: 'views/data/data-analysis.html'
  link: ($scope,  element, attrs)->
)

app.directive('dotaUser', ->
  restrict: 'E'
  replace: true
  scope: {}
  templateUrl: 'views/data/data-user.html'
  link: ($scope,  element, attrs)->
    $scope.userGroup = male: 11, man: 9
)